package interfaz;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;

/**
 *
 * @author Nerea
 */
public class PanelModificarSensor extends javax.swing.JPanel {

	// Variables declaration - do not modify
    private javax.swing.JButton bAceptar;
    private javax.swing.JButton bAtras;
    private javax.swing.JButton bOff;
    private javax.swing.JButton bOn;
    private javax.swing.JTextField jTextField;
    private javax.swing.JLabel lTitulo;
    private javax.swing.JLabel lestado;
    private PanelInicial panelInicial;
    private PanelMenu panelMenu;
    // End of variables declaration
    
    /**
     * Creates new form PanelModificarSensor
     */
    public PanelModificarSensor(PanelInicial pI, PanelMenu pM) {
        
    	panelInicial = pI;
    	panelMenu = pM;
        bAtras = new javax.swing.JButton();
        bAceptar = new javax.swing.JButton();
        lTitulo = new javax.swing.JLabel();
        bOn = new javax.swing.JButton();
        bOff = new javax.swing.JButton();
        lestado = new javax.swing.JLabel();
        jTextField = new javax.swing.JTextField();

        setLayout(null);

        bAtras.setText("Atras");
        bAtras.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {
				menu(evt);
			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
        add(bAtras);
        bAtras.setBounds(120, 520, 80, 32);

        bAceptar.setText("Aceptar");
        add(bAceptar);
        bAceptar.setBounds(600, 520, 85, 32);

        lTitulo.setFont(new java.awt.Font("Tempus Sans ITC", 1, 24)); // NOI18N
        lTitulo.setText("Modificar estado de sensor");
        add(lTitulo);
        
        bOn.setIcon(new ImageIcon("src/resources/ON.png"));
        bOff.setIcon(new ImageIcon("src/resources/OFF.png"));
        
        lTitulo.setBounds(120, 70, 314, 37);
        add(bOn);
        bOn.setBounds(210, 220, 134, 133);
        add(bOff);
        bOff.setBounds(430, 220, 134, 133);

        lestado.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        lestado.setText("Estado: ");
        add(lestado);
        lestado.setBounds(320, 410, 70, 30);
        add(jTextField);
        jTextField.setBounds(390, 410, 60, 30);
    }// </editor-fold>
    
    private void menu(MouseEvent evt) {
		this.setVisible(false);
		panelInicial.ventana.getContentPane().add(panelMenu, 0);
		panelMenu.setVisible(true);
	}
    
}

